package com.warmheart.core.co.builder;

import com.warmheart.core.cors.builder.CoRsBuilder;

/**
 * 
 * @ClassName: CoBuilder
 * @Description: 自定义查询、排序核心接口
 * @author ZhangJianyang
 * @date 2025-06-16 09:37:02
 *
 * @param <T>
 */
public interface CoBuilder<T extends CoRsBuilder<?, ?>> {

    /**
     * 
     * @Title: core
     * @Description: 核心对象
     * @author ZhangJianyang
     * @return
     */
    public T core();

    /**
     * 
     * @Title: clearCnd
     * @Description: 清理条件设置
     * @author ZhangJianyang
     * @return
     */
    default T clearCnd() {
        this.core().getRelationModelList().clear();
        return this.core();
    }

    /**
     * 
     * @Title: clearOb
     * @Description: 清理排序设置
     * @author ZhangJianyang
     * @return
     */
    default T clearOb() {
        this.core().getOrderByModelList().clear();
        return this.core();
    }

    /**
     * 
     * @Title: clear
     * @Description: 清理条件以及排序设置
     * @author ZhangJianyang
     * @return
     */
    default T clear() {
        this.core().getRelationModelList().clear();
        this.core().getOrderByModelList().clear();
        return this.core();
    }
}
